package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShareMapper;
import com.ruoyi.system.domain.Share;
import com.ruoyi.system.service.IShareService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户分享Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-08-03
 */
@Service
public class ShareServiceImpl implements IShareService 
{
    @Autowired
    private ShareMapper shareMapper;

    /**
     * 查询客户分享
     * 
     * @param id 客户分享ID
     * @return 客户分享
     */
    @Override
    public Share selectShareById(Long id)
    {
        return shareMapper.selectShareById(id);
    }

    /**
     * 查询客户分享列表
     * 
     * @param share 客户分享
     * @return 客户分享
     */
    @Override
    public List<Share> selectShareList(Share share)
    {
        return shareMapper.selectShareList(share);
    }

    /**
     * 新增客户分享
     * 
     * @param share 客户分享
     * @return 结果
     */
    @Override
    public int insertShare(Share share)
    {
        share.setCreateTime(DateUtils.getNowDate());
        return shareMapper.insertShare(share);
    }

    /**
     * 修改客户分享
     * 
     * @param share 客户分享
     * @return 结果
     */
    @Override
    public int updateShare(Share share)
    {
        share.setUpdateTime(DateUtils.getNowDate());
        return shareMapper.updateShare(share);
    }

    /**
     * 删除客户分享对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteShareByIds(String ids)
    {
        return shareMapper.deleteShareByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客户分享信息
     * 
     * @param id 客户分享ID
     * @return 结果
     */
    @Override
    public int deleteShareById(Long id)
    {
        return shareMapper.deleteShareById(id);
    }
}
